#ifndef NETWORKMANAGER_H
#define NETWORKMANAGER_H

/* 将连接服务器的逻辑封装到NetworkManager类中  让mainface和teacherterminal共享一个连接，避免重复连接服务器 */

#include <QObject>
#include <QTcpSocket>

class NetworkManager :public QObject
{
    Q_OBJECT
public:
    explicit NetworkManager(QObject* parent = nullptr);
    bool connectToServer(const QString &host,quint16 port);
    QTcpSocket* getSocket();

private:
    QTcpSocket* socket;
};

#endif // NETWORKMANAGER_H
